package cn.tedu.lucky.draw.server.job.processor;

import cn.tedu.lucky.draw.server.protocol.po.Activity;
import org.springframework.batch.item.ItemProcessor;

import java.time.LocalDateTime;

public class ActivityProcessor implements ItemProcessor<Activity, Activity> {
    @Override
    public Activity process(Activity activity) throws Exception {
        LocalDateTime now = LocalDateTime.now();
        activity.setStartTime(now);
        activity.setEndTime(now.plusDays(7));
        activity.setCreateTime(now);
        activity.setUpdateTime(now);
        return activity;
    }
}
